import { SHOP_ORIGIN, YEARS_ORIGIN, STYLE_ORIGIN, TYPE_ORIGIN } from './dic'

const statusFilter = value => {
  const statusMap = {
    0: '试用终止',
    1: '待审核',
    2: '待提交',
    3: '待修改',
    4: '待确认',
    5: '已完成',
    6: '审核不通过'
  }
  return statusMap[value]
}

const goldTypeFilter = value => {
  const map = {
    1: '邀请奖励',
    2: '余额充值',
    3: '试用消费'
  }
  return map[value]
}

const originFilter = value => {
  for (let i = 0; i < SHOP_ORIGIN.length; i++) {
    if (SHOP_ORIGIN[i].key === value) {
      return SHOP_ORIGIN[i].value
    }
  }
  return ''
}

const workingAge = value => {
  for (let i = 0; i < YEARS_ORIGIN.length; i++) {
    if (YEARS_ORIGIN[i].key === value) {
      return YEARS_ORIGIN[i].value
    }
  }
}

const style = value => {
  for (let i = 0; i < STYLE_ORIGIN.length; i++) {
    if (STYLE_ORIGIN[i].key === value) {
      return STYLE_ORIGIN[i].value
    }
  }
}

const type = value => {
  for (let i = 0; i < TYPE_ORIGIN.length; i++) {
    if (TYPE_ORIGIN[i].key === value) {
      return TYPE_ORIGIN[i].value
    }
  }
}

const designerCaseStatus = value => {
  const caseStatus = {
    1: '待审核',
    2: '通过',
    3: '不通过'
  }
  return caseStatus[value]
}

const designerCaseType = value => {
  const caseType = {
    1: '家装',
    2: '工装'
  }
  return caseType[value]
}
export { statusFilter, goldTypeFilter, originFilter, workingAge, style, type, designerCaseStatus, designerCaseType }
